﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using TaskQueueDemo.ViewModels;

namespace TaskQueueDemo.ViewModel
{
    public class TaskContext : INotifyPropertyChanged
    {

        private string _taskDesc;
        public string TaskDesc
        {
            get => _taskDesc;
            set { _taskDesc = value; OnPropertyChanged(); }
        }

        private string _taskDesc1;
        private TaskItem taskItem;

        public TaskContext(TaskItem taskItem)
        {
            this.taskItem = taskItem;
        }

        public string TaskDesc1
        {
            get => _taskDesc1;
            set { _taskDesc1 = value; OnPropertyChanged(); }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }

        public void SetTaskDesc()
        {
            TaskDesc = taskItem.Name + "描述";
        }
    }
}
